Skip to content

feat(mobile): show remote instance model catalogs - #5146

Merged
iscekic merged 14 commits into
mainfrom
cli-provider-picker-b01e
Aug 8, 2026
Merged

feat(mobile): show remote instance model catalogs#5146
iscekic merged 14 commits into
mainfrom
cli-provider-picker-b01e

Conversation

@iscekic

@iscekic iscekic commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Users can select a remote CLI instance and see that instance’s providers and models before starting a session. The app keeps the Kilo Gateway fallback when the instance cannot provide a catalog.

Product managers get provider-aware new-session and continue-session flows for remote CLI instances. Switching instances removes stale selections, and Cloud Agent behavior stays unchanged.

Maintainers get a strict sessionless SDK catalog request, per-instance React Query state, validated model selections, and the existing picker projection reused for gateway fallback and CLI catalogs. This cloud PR depends on PR #5138, which must merge first. The kilocode PR #13014 is the remaining runtime dependency: until it ships, instances reject the sessionless request and the designed Kilo Gateway fallback remains visible. A pre-existing issue can pass an opaque remote-model-N value when continuing a CLI-catalog session into Cloud Agent; this remains out of scope.

E2E: bot-e2e — latest-head verification passed R1 and S1–S6. R1 proves the first catalog option keeps its offered variant. S1 proves the sessionless catalog and provider group. S2 proves a non-Kilo prompt through the local e2e-local/stub-model; the transcript shows E2E stub provider answered., the in-session picker shows provider e2e-local, and the stub log records model=stub-model. S3 proves Kilo Gateway compatibility and Cloud Agent loading isolation. S4 proves instance switching removes the stale model. S5 proves Continue in a new session. S6 proves the old-CLI gateway fallback without a blocking error.

Visual Changes:

  • Latest catalog and Cloud Agent picker: s1-screenshot.png
  • Latest non-Kilo session: s2-screenshot.png
  • Latest continue session: s5-screenshot.png
  • Latest old-CLI fallback: s6-screenshot.png

Human steps:

  • Before merge: merge PR feat(mobile): show BYOK badges for CLI models #5138.
  • Before merge: merge PR #13014 so new CLI instances answer the sessionless catalog request.
  • After merge: deploy the normal cloud release.
  • No migration, secret, environment value, or feature flag change is needed.

@iscekic
iscekic requested a review from jeanduplessis August 7, 2026 18:57
@iscekic iscekic self-assigned this Aug 7, 2026
@iscekic
iscekic requested a review from RSO August 7, 2026 18:57
@kilo-code-bot

kilo-code-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of the 62bb7734 hardening commit and the main merge: the first-catalog-option fallback now derives its variant with the established picker rule (keep current variant if offered, else first offered variant) and threads it consistently into selectedVariant and spawnSelection; the SDK's strict catalog parse is wrapped so an unexpected throw classifies as transport and never escapes listInstanceModels (covered by a new test); the new.tsx loading gate on isRemoteTargetSelected is behavior-neutral hardening since the catalog hook already reports isLoading: false without a connection id; the seed resolve-user.tsusers.ts rename leaves no dangling imports. No memory leaks or stale-state issues introduced.

Files Reviewed (8 files, incremental since 07d23cd)
  • apps/mobile/src/app/(app)/agent-chat/new.tsx
  • apps/mobile/src/components/agents/model-selector-badges.ts
  • apps/mobile/src/components/agents/new-session-model-view.test.ts
  • apps/mobile/src/components/agents/new-session-model-view.ts
  • dev/seed/app/usage-evidence.ts
  • dev/seed/lib/users.ts (renamed from resolve-user.ts)
  • packages/cloud-agent-sdk/src/instance-model-catalog.test.ts
  • packages/cloud-agent-sdk/src/instance-model-catalog.ts

Notes (non-blocking, not flagged as findings):

  • The merge from main also touched files outside this PR's combined diff (offline banner, extension, web, auto-routing); those are base-branch changes, not this PR's scope.
  • Per PR description, merging remains gated on PR feat(mobile): show BYOK badges for CLI models #5138 and the companion kilocode CLI PR.
Previous Review Summaries (2 snapshots, latest commit 07d23cd)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 07d23cd)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of the mode-threading refactor and seed-script cleanup: the RemoteSpawnInheritanceProvider context is fully removed with no dangling references, mode is now threaded explicitly and type-safely (AgentMode from useNewSessionModelState through useNewSessionShareRemote into useRemoteSpawnDispatch), the removed remoteModelCatalogV1Schema subpath re-export has no in-repo consumers (it remains exported from the SDK root), the unused unavailable badge field removal matches the function body which never read it, and the dev/seed resolveUserId/isValidEmail extraction into lib/resolve-user.ts is a behavior-preserving deduplication. No memory leaks or stale-state issues introduced.

Files Reviewed (12 files, incremental since a989d07)
  • apps/mobile/src/app/(app)/agent-chat/new.tsx
  • apps/mobile/src/components/agents/continue-remote-spawn-input.test.ts (renamed from resolve-continue-remote-model.test.ts)
  • apps/mobile/src/components/agents/model-selector-badges.test.ts
  • apps/mobile/src/components/agents/model-selector-badges.ts
  • apps/mobile/src/components/agents/new-session-model-provider.tsx
  • apps/mobile/src/components/agents/use-remote-spawn-dispatch.test.ts
  • apps/mobile/src/components/agents/use-remote-spawn-dispatch.ts
  • apps/mobile/src/lib/use-new-session-share-remote.ts
  • dev/seed/app/byok-e2e-fixture.ts
  • dev/seed/app/usage-evidence.ts
  • dev/seed/lib/resolve-user.ts
  • packages/cloud-agent-sdk/src/instance-model-catalog.ts

Notes (non-blocking, not flagged as findings):

  • The renamed test file continue-remote-spawn-input.test.ts still imports from ./continuation-seed; the name no longer mirrors its source file, but vitest discovery is unaffected.
  • Removing remoteModelCatalogV1Schema from the ./instance-model-catalog subpath narrows that subpath's public surface; the schema remains available from the package root and no in-repo importer used the subpath for it.
  • Per PR description, merging remains gated on PR feat(mobile): show BYOK badges for CLI models #5138 and the companion kilocode CLI PR.

Previous review (commit a989d07)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the remote instance model catalog feature across the SDK and mobile app: the sessionless list_models helper is fail-closed with strict schema validation, per-instance React Query caching and retry classification are sound, the model-selection refactor is consistently propagated to all call sites, and no memory leaks or stale-state bugs were found.

Files Reviewed (19 files)
  • packages/cloud-agent-sdk/package.json
  • packages/cloud-agent-sdk/src/instance-model-catalog.ts
  • packages/cloud-agent-sdk/src/instance-model-catalog.test.ts
  • apps/mobile/src/lib/hooks/remote-instance-spawn-classifier.ts
  • apps/mobile/src/lib/hooks/use-remote-instance-spawn.test.ts
  • apps/mobile/src/lib/hooks/use-instance-model-catalog.ts
  • apps/mobile/src/components/agents/new-session-model-view.ts
  • apps/mobile/src/components/agents/new-session-model-view.test.ts
  • apps/mobile/src/components/agents/continuation-seed.ts
  • apps/mobile/src/components/agents/resolve-continue-remote-model.test.ts
  • apps/mobile/src/components/agents/use-continue-session.ts
  • apps/mobile/src/app/(app)/agent-chat/new.tsx
  • apps/mobile/src/components/agents/chat-toolbar.tsx
  • apps/mobile/src/components/agents/new-session-configure-form.tsx
  • apps/mobile/src/components/agents/new-session-model-provider.tsx
  • apps/mobile/src/components/agents/new-session-prompt.tsx
  • apps/mobile/src/components/agents/use-remote-spawn-dispatch.ts
  • apps/mobile/src/components/agents/use-remote-spawn-dispatch.test.ts
  • apps/mobile/src/lib/use-new-session-share-remote.ts

Notes (non-blocking, not flagged as findings):

  • useContinueSession fetches the catalog via a direct listInstanceModels call rather than the shared React Query cache from the new-session screen; this appears deliberate (fresh validation at continue time) and matches the PR's design.
  • Per PR description, merging is gated on PR feat(mobile): show BYOK badges for CLI models #5138 and the companion kilocode CLI PR; no deployment, secret, migration, or flag changes are needed.

Reviewed by kimi-k3 · Input: 145.4K · Output: 17.9K · Cached: 856.7K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic changed the base branch from byok-model-picker-5bd1 to main August 7, 2026 19:06
@iscekic
iscekic requested a review from jeanduplessis August 7, 2026 23:46
@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 7, 2026
@iscekic
iscekic merged commit 3bb42a7 into main Aug 8, 2026
20 checks passed
@iscekic
iscekic deleted the cli-provider-picker-b01e branch August 8, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants